﻿using PLCSharp.CoreModel.Common;
using PLCSharp.CoreModel.Prism;
using PLCSharp.Views.Vision.Camera;
using Prism.Mvvm;
using System.Text.Json.Serialization;

namespace PLCSharp.Views.Vision
{
    public class VisionFlow : BindableBase
    {

        private VisionFlowType _Type;
        /// <summary>
        /// 
        /// </summary>
        public VisionFlowType Type
        {
            get { return _Type; }
            set
            {
                SetProperty(ref _Type, value);
            }
        }


        private string _Comment;
        /// <summary>
        /// 
        /// </summary>
        public string Comment
        {
            get { return _Comment; }
            set { SetProperty(ref _Comment, value); }
        }

        private ObservableDictionary<string, string> _StringParams = [];
        /// <summary>
        /// 
        /// </summary>
        public ObservableDictionary<string, string> StringParams
        {
            get { return _StringParams; }
            set { SetProperty(ref _StringParams, value); }
        }
        private ObservableDictionary<string, float> _FloatParams = [];
        /// <summary>
        /// 
        /// </summary>
        public ObservableDictionary<string, float> FloatParams
        {
            get { return _FloatParams; }
            set { SetProperty(ref _FloatParams, value); }
        }
        private ObservableDictionary<string, double> _DoubleParams = [];
        /// <summary>
        /// 
        /// </summary>
        public ObservableDictionary<string, double> DoubleParams
        {
            get { return _DoubleParams; }
            set { SetProperty(ref _DoubleParams, value); }
        }

        private ObservableDictionary<string, long> _LongParams = [];
        /// <summary>
        /// 
        /// </summary>
        public ObservableDictionary<string, long> LongParams
        {
            get { return _LongParams; }
            set { SetProperty(ref _LongParams, value); }
        }


        private ObservableDictionary<string, int> _IntParams = [];
        /// <summary>
        /// 
        /// </summary>
        public ObservableDictionary<string, int> IntParams
        {
            get { return _IntParams; }
            set { SetProperty(ref _IntParams, value); }
        }
        private ObservableDictionary<string, bool> _BoolParams = [];
        /// <summary>
        /// 
        /// </summary>
        public ObservableDictionary<string, bool> BoolParams
        {
            get { return _BoolParams; }
            set { SetProperty(ref _BoolParams, value); }
        }

        private FlowModel _Flow = new();
        [JsonIgnore]
        public FlowModel Flow
        {
            get { return _Flow; }
            set
            {
                if (value != null) _Flow = value;

                   
            }
        }
        [JsonIgnore]
        public CameraBase Camera { get; set; }
    }
}
